import { createApp } from 'vue'
import App from './App.vue'
import '@/assets/css/reset.css'
import '@/assets/css/custom.css'
import { router } from './router'
import { createPinia } from 'pinia';
import { terminalStore } from './store'
import { getTerminal } from './utils'
import { cssToRem } from './utils/rem-config'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import '@/assets/icon-font/iconfont.js'
import { userInfoStore } from './store';

const store = createPinia();
const app = createApp(App)

app.use(store)
app.use(router)
app.use(ElementPlus)
// 初始化仓库
terminalStore().setTerminal(getTerminal())
cssToRem()

const initUserInfoStore = userInfoStore()

const localUserInfo = localStorage.getItem('userInfo')

initUserInfoStore.setUserInfo(localUserInfo ? JSON.parse(localUserInfo) : {})


app.mount('#app')
